package com.zan.pattern.factory.factory_method;

/**
 * @Author Zan
 * @Create 2024/4/24 20:28
 * @Description : TODO(请用一句话描述该类的功能)
 * @ClassName: CofferStore
 */
public class CoffeeStore {

    private CoffeeFactory factory;

    public void setFactory(CoffeeFactory factory) {
        this.factory = factory;
    }

    // 点咖啡功能
    public Coffee orderCoffee() {
        Coffee coffee = factory.createCoffee();
        // 加配料
        coffee.addMike();
        coffee.addSugar();
        return coffee;
    }
}
